#pragma once

#include <QtGui/QGraphicsPixmapItem>
#include <QtGui/QPixmap>
#include <QtGui/QTransform>
#include "QtAnimStruct.h"

class QtGraphicsStateScene;
class QtVariantProperty;
class QtButtonPropertyBrowser;
class QtTreePropertyBrowser;
class QtGroupBoxPropertyBrowser;
class QtVariantPropertyManager;
class QtProperty;


class QtGraphicsStateItem : public QObject, public QGraphicsPixmapItem
{
	Q_OBJECT
public:
	QtGraphicsStateItem(QGraphicsItem* parent = 0);
	virtual ~QtGraphicsStateItem(void);

	QtTransform getState() const { return mStateTrans; }
	void setState(QtTransform trans) { mStateTrans = trans; }

	friend QDataStream & operator << (QDataStream &dataStream, QtGraphicsStateItem &itemBase);
	friend QDataStream & operator >> (QDataStream &dataStream, QtGraphicsStateItem &itemBase);
	virtual void save(QDataStream &dataStream);
	virtual void load(QDataStream &dataStream);

protected:
	virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
	virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);

	QVariant itemChange(GraphicsItemChange change, const QVariant &value);
signals:
	void posChanged();
private:
	QtTransform mStateTrans;
};
